﻿using System.Collections.Generic;

namespace lwzlz.Application.System
{
    /// <summary>
    /// 
    /// </summary>
    public class LoginUser
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        public int UserID { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// 用户真实姓名
        /// </summary>
        public string RealName { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        public int Sex { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        public string ProfilePhoto { get; set; }

        /// <summary>
        /// 手机号码
        /// </summary>
        public string MobilePhone { get; set; }

        /// <summary>
        /// 固定电话
        /// </summary>
        public string Telephone { get; set; }

        /// <summary>
        /// 用户角色ID集合
        /// </summary>
        public IEnumerable<int> RoleIds { get; set; }

        /// <summary>
        /// 角色编码集合
        /// </summary>
        public IEnumerable<string> RoleCodes { get; set; }

        /// <summary>
        /// 角色名称集合
        /// </summary>
        public IEnumerable<string> RoleNames { get; set; }

        /// <summary>
        /// 是否为管理员
        /// </summary>
        /// <returns></returns>
        public bool IsAdministrator()
        {
            // XXX: 测试，待改
            return this.UserID == 1;
        }
    }

    /// <summary>
    /// 
    /// </summary>
    public partial class UserLoginRole
    {
        /// <summary>
        /// 
        /// </summary>
        public int RoleID { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string RoleCode { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string RoleName { get; set; }
    }
}
